package server.orders;

import java.util.Arrays;
import java.util.List;

import server.database.AbstractTable;
import server.database.DatabaseColumn;

public class CustomersOrdersTable extends AbstractTable
{
	public static final String TABLE_NAME = "Customers_Orders";

	public static final DatabaseColumn CUSTOMER_ORDER_ID = new DatabaseColumn("customer_order_id", INTEGER, Arrays.asList(AUTO_INCREMENT));
	public static final DatabaseColumn CUSTOMER_ID = new DatabaseColumn("customer_id", INTEGER, Arrays.asList(NOT_NULL));
	public static final DatabaseColumn ORDER_ID = new DatabaseColumn("order_id", INTEGER, Arrays.asList(UNIQUE));

	public final List<DatabaseColumn> m_lstColumns = Arrays.asList(ORDER_ID, CUSTOMER_ORDER_ID, CUSTOMER_ID);
	public final List<DatabaseColumn> m_lstKey = Arrays.asList(CUSTOMER_ID, CUSTOMER_ORDER_ID);

	@Override
	public String getTableName()
	{
		return TABLE_NAME;
	}

	@Override
	public List<DatabaseColumn> getColumns()
	{
		return m_lstColumns;
	}

	@Override
	public List<DatabaseColumn> getPrimaryKey()
	{
		return m_lstKey;
	}

	@Override
	public String setTableDBEngine()
	{
		return ENGINE_MYISAM;
	}
}
